Skip to content

Conversation

@shiyasmohd
Copy link
Contributor

No description provided.

@shiyasmohd shiyasmohd requested a review from isum October 18, 2024 15:24
@shiyasmohd shiyasmohd self-assigned this Oct 20, 2024
Copy link
Member

@isum isum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good, but there are a few things to consider before I can complete my review:

  • I would suggest rethinking the approach with warnings, so that we are not hiding potentially important details from users. It might be a good idea to break the commands into smaller pieces to allow more flexibility in the interfaces that assemble the commands (it is important not to allow assembling wrong commands);
  • When I introduced the GraphQL API, we agreed that all implemented commands should have tests, and there are no tests for the new GraphQL commands;
  • The primary use case for extracting the Graphman commands into a separate crate and breaking them into smaller pieces was to share the functionality between the CLI and the GraphQL API, but this PR does not share the extracted code with the CLI;

Copy link
Member

@isum isum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good, but I would suggest you use the extracted functionality of reassign and unassign in the CLI modules to remove some code duplication. The goal is to eventually share as much functionality as possible between the CLI and the GraphQL API.

@shiyasmohd shiyasmohd force-pushed the shiyasmohd/add-unassign-reassign-to-graphman-api branch 2 times, most recently from 63f0a8f to 8bdc003 Compare December 26, 2024 01:29
@shiyasmohd shiyasmohd force-pushed the shiyasmohd/add-unassign-reassign-to-graphman-api branch from 827491c to d0d7d5c Compare December 28, 2024 03:29
@shiyasmohd shiyasmohd requested a review from isum January 2, 2025 10:22
Comment on lines +39 to +42
pub enum ReassignResult {
EmptyResponse,
CompletedWithWarnings(Vec<String>),
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note. It is not very common for a Rust function to return T::EmptyResponse on success (it makes sense for GraphQL types because of GraphQL style and conventions). Maybe a better name for this variant is ReassignResult::Ok, but that's not really important right now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. I've created a new issue for that.

@shiyasmohd shiyasmohd merged commit 8bc4645 into master Feb 17, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants